//
// ConnectionManager.cpp
// ~~~~~~~~~~~~~~~~~~~~~~
//
// Copyright (c) 2003-2013 Christopher M. Kohlhoff (chris at kohlhoff dot com)
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#include "ConnectionManager.h"

namespace http
{
	namespace server
	{

		ConnectionManager::ConnectionManager()
		{}

		void ConnectionManager::start(m_connection c)
		{
			connections_.insert(c);
			c->start();
		}

		void ConnectionManager::stop(m_connection c)
		{
			connections_.erase(c);
			c->stop();
		}

		void ConnectionManager::stop_all()
		{
			for (auto c : connections_)
				c->stop();
			connections_.clear();
		}

	} // namespace server
} // namespace http